import { onMounted, ref } from "vue";
import axios from "@/utils/axios";

class Mixplant{
    private _id: number | undefined
    private _name: string | undefined
    private _type: string | undefined

    get id(): number | undefined {
        return this._id;
    }

    set id(value: number | undefined) {
        this._id = value;
    }

    get name(): string | undefined {
        return this._name;
    }

    set name(value: string | undefined) {
        this._name = value;
    }

    get type(): string | undefined {
        return this._type;
    }

    set type(value: string | undefined) {
        this._type = value;
    }
}

export default ()=>{
    const mixplantChecked = ref(new Mixplant())
    const mixList = ref(null);

    // 获取拌合站列表
    let getMixPlant = ()=>{
        axios
            .post("/mix/mixplant/getAll",)
            .then((res) => {
                mixList.value = res.data;
            });
    }

    onMounted(()=>{
        getMixPlant();
    })

    return {
        mixList,
        mixplantChecked
    }
}